<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

</body>
<script>
    function Person(name,age){
			this.name=name;
		    this.age=age
	}
	function Student(name,age,grade){
		this.grade=grade;
	    Person.apply(this,arguments)
	
	}
	let studengtA=new Student('小A',10,'2年级')
	console.log(studengtA);
	
    let A = 1000053;
    console.log(A.toString().substring(0, 5));

    // Object.keys(), Object.values()，Object.entries()
    console.log(Object);

    // let {keys, values, entries} = Object;
    let obj = {a: 1, b: 2, c: 3};

    for (let key of Object.keys(obj)) {
        console.log(key); // 'a', 'b', 'c'
    }

    for (let value of Object.values(obj)) {
        console.log(value); // 1, 2, 3
    }

    for (let [key, value] of Object.entries(obj)) {
        console.log([key, value]); // ['a', 1], ['b', 2], ['c', 3]
    }

    // 扩展运算符（…）用于取出参数对象的所有可遍历属性，拷贝到当前对象之中。
    // let z = { a: 3, b: 4 };
    // let n = {...z};
    // console.log(n) // { a: 3, b: 4 }

    var person1 = {
        "name": "xianyu",
        "age": 24,
        "love": "Online Game"
    }
    //和
    var person2 = {
        name: 'xianyu',
        age: 24,
        love: 'Online Game',
        skill: function () {
            alert('basketball')
        }
    }
    console.log(person1);
    console.log(person2);
</script>
</html>